import { isArray, isObject, isString } from "./is"
export const cs = (...args) => {
    const length = args.length
    let classNames = []
    for (let i = 0; i < length; i++) {
        const v = args[i]
        if (!v) {
            continue
        }
        if (isString(v)) {
            classNames.push(v)
        } else if (isArray(v)) {
            classNames = classNames.concat(v)
        } else if (isObject(v)) {
            Object.keys(v).forEach(k => {
                if (v[k]) {
                    classNames.push(k)
                }
            })
        } else {
            console.warn("arguments must be one of string/array/object")
        }
    }
    return [...new Set(classNames)].join(" ")
}